home *** CD-ROM | disk | FTP | other *** search
/ NeXT Enterprise Objects Framework 1.1 / NeXT Enterprise Objects Framework 1.1.iso / NextDeveloper / Headers / eoaccess / EOJoin.h < prev    next >
Encoding:
Text File  |  1994-08-19  |  2.5 KB  |  76 lines

  1. // EOJoin.h
  2. // Copyright (c) 1994, NeXT Computer, Inc. All rights reserved. 
  3.  
  4. #import <foundation/NSArray.h>
  5. #import <foundation/NSData.h>
  6. #import <foundation/NSDictionary.h>
  7. #import <foundation/NSObject.h>
  8. #import <foundation/NSString.h>
  9.  
  10. @class EOEntity;
  11. @class EOAttribute;
  12.  
  13.  
  14. typedef enum {
  15.     EOInnerJoin = 0, EOFullOuterJoin,
  16.     EOLeftOuterJoin, EORightOuterJoin
  17. } EOJoinSemantic;
  18.     // EOJoinSemantic specifies the manner in which a join should be made.
  19.     // An inner join (also known as an equijoin) produces results only for
  20.     // destinations of the join relationship that have non-null values.  A
  21.     // full outer join produces results for all source records, regardless of
  22.     // the values of the relationships.  A left outer join preserves rows in
  23.     // the left (source) table (keeps them even if there's no corresponding
  24.     // row in the right table), while a right outer join preserves rows in the
  25.     // right (destination) table.  Not all join semantics are supported by all
  26.     // database servers.
  27.  
  28.  
  29. typedef enum {
  30.     EOJoinEqualTo = 0, EOJoinNotEqualTo,
  31.     EOJoinGreaterThan, EOJoinGreaterThanOrEqualTo,
  32.     EOJoinLessThan, EOJoinLessThanOrEqualTo
  33. } EOJoinOperator;
  34.     // EOJoinOperator defines the possible comparison method to use in
  35.     // building a join.  Attributes fitting the comparison are included in the
  36.     // join; those not fitting are excluded.
  37.  
  38.  
  39. // An EOJoin describes one source/destination attribute pair for a
  40. // relationship. It holds the join semantic and the join operator for an
  41. // attribute pair.
  42.  
  43.  
  44. @interface EOJoin:NSObject
  45. {
  46.     EOJoinSemantic _joinSemantic;
  47.     EOJoinOperator _joinOperator;
  48.     EOAttribute *_sourceAttribute;
  49.     EOAttribute *_destinationAttribute;
  50. }
  51.  
  52. - initWithSourceAttribute:(EOAttribute *)source
  53.     destinationAttribute:(EOAttribute *)destination
  54.     joinOperator:(EOJoinOperator)joinOperator
  55.     joinSemantic:(EOJoinSemantic)joinSemantic;
  56.     // Initializes a newly allocated EOJoin with the given information.
  57.     // Returns self.
  58.  
  59. - (EOJoinSemantic)joinSemantic;
  60. - (EOJoinOperator)joinOperator;
  61. - (EOAttribute *)sourceAttribute;
  62. - (EOAttribute *)destinationAttribute;
  63.     // These methods return the information held by the EOJoin.
  64.  
  65. @end
  66.  
  67. @interface EOJoin(EOJoinEditing)
  68.  
  69. - (void)setJoinOperator:(EOJoinOperator)jo;
  70. - (void)setJoinSemantic:(EOJoinSemantic)js;
  71. - (void)setDestinationAttribute:(EOAttribute *)attribute;
  72. - (void)setSourceAttribute:(EOAttribute *)attribute;
  73.     // These methods set the information held by the EOJoin.
  74.  
  75. @end
  76.